package com.blueocean_health.care.management.controller;

import com.blueocean_health.care.management.domain.base.SysResult;
import com.blueocean_health.care.management.domain.dto.HomeCalcRequest;
import com.blueocean_health.care.management.service.HomeCalcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录首页统计相关
 */
@RestController
@RequestMapping("/home")
public class HomeCalcController {

    @Autowired
    private HomeCalcService homeCalcService;

    /**
     * 获取统计的选项
     * @param request
     * @return
     */
    @RequestMapping("/param")
    public SysResult param(@RequestBody(required = false) HomeCalcRequest request){
        return homeCalcService.param(request);
    }

    /**
     * 获取统计的选项
     * @param request
     * @return
     */
    @RequestMapping("/data")
    public SysResult data(@RequestBody(required = false) HomeCalcRequest request){
        return homeCalcService.data(request);
    }

    /**
     * 重新计算数据
     * @param request
     * @return
     */
    @RequestMapping("/calc")
    public SysResult calc(@RequestBody(required = false) HomeCalcRequest request){
        return homeCalcService.calc(request);
    }

}
